package cn.edu.scau.cmi.luotiansheng_chapter10;

import java.io.*;
import java.util.*;

public class Example10_15 {
	public static void main(String[] args) {
		File file=new File("cost.txt");
		Scanner sc=null;
		int sum=0;
		try {
			sc=new Scanner(System.in);
			while(sc.hasNext()) {
				try {
					int price=sc.nextInt();
					sum+=price;
					System.out.println(price);
				}catch(InputMismatchException e) {
					String str=sc.next();
				}
			}
			System.out.println("Total CostL"+sum+" dollar");
			
		}catch(Exception exp) {
			System.out.println(exp);
		}
	}
}
